<script lang="ts" setup>
import { SvgIcon } from '../svg-icon'
// const value = defineModel<string>()
</script>

<template>
  <div class="h-[200px] w-full" :class="$style.upload">
    <el-upload
      class="h-full w-full" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
      multiple
    >
      <div class="h-full w-full flex flex-col items-center">
        <div class="mb-2 h-0 w-full flex-auto">
          <el-auto-resizer>
            <template #default="{ height }">
              <SvgIcon :size="height" color="var(--el-color-info)" name="i-eva:image-2-fill" />
            </template>
          </el-auto-resizer>
        </div>
        <el-text type="info">
          背景图需小于 5M ，格式为 png/jpg/gif 的文件
        </el-text>
      </div>
    </el-upload>
  </div>
</template>

<style lang="scss" module>
.upload {
  :global {
    .el-upload {
      height: 100%;

      .el-upload-dragger {
        height: 100%;
        width: 100%;
      }
    }
  }
}
</style>
